package com.yanqu.xiuxian.config.elementalbonds.enums;

import java.util.Arrays;

public enum ElementalBondsModeType {

    GUIDE(-1, "新手引导"),
    NONE(0, "无"),
    NEW_HAND_PVP(1, "新手段位对战"),
    PVP(2, "玩家对战"),
    PRACTICE(3, "练习"),
    FRIEND_PK(4, "好友对战"),
    ;

    private final int type;
    private final String desc;

    ElementalBondsModeType(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static ElementalBondsModeType forType(int type) {
        return Arrays.stream(ElementalBondsModeType.values())
                .filter(elementalBondsModeType -> elementalBondsModeType.getType() == type)
                .findFirst()
                .orElse(NONE);
    }

    public int getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

}
